/*
    created: 2023/4/3
    filename: Prototype.h
    author: 李东霖
    purpose: Prototype的演示代码

*/

#ifndef _PROTOTYPE_H_
#define _PROTOTYPE_H_

class Prototype
{

public:
    Prototype() = default;
    virtual ~Prototype() = default;
    //提供Clone方法
    virtual Prototype* Clone() = 0;
};

//Prototype的第一个派生类
class ConcreatePrototype1:public Prototype
{
public:
    ConcreatePrototype1();
    //拷贝构造
    ConcreatePrototype1(const ConcreatePrototype1&);
    virtual ~ConcreatePrototype1();

    virtual Prototype* Clone() override;
};

//Prototype的第二个派生类
class ConcreatePrototype2:public Prototype
{
public:
    ConcreatePrototype2();
    //拷贝构造
    ConcreatePrototype2(const ConcreatePrototype2&);
    virtual ~ConcreatePrototype2();

    virtual Prototype* Clone() override;
};



#endif //!_PROTOTYPE_H_
